package org.groupg.project;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

import java.util.ArrayList;
import java.util.List;

@Parameters(separators = "=")
public class ProxyServerArgs {
    @Parameter(
        names = {"-c", "--config"},
        description = "请指定对应的配置文件，按照逗号分割（例如 /home/user/config/config01.xml,/home/user/config/config02.json）",
        listConverter = ConfigListConverter.class
    )
    private List<String> configPaths = new ArrayList<>();

    @Parameter(
        names = {"-g", "--generate-examples"},
        description = "在指定的目录中生成示例配置"
    )
    private String examplesOutputDir;

    @Parameter(
        names = {"--help", "-h"},
        description = "展示帮助",
        help = true
    )
    private boolean help;

    // Getters
    public List<String> getConfigPaths() {
        return configPaths;
    }

    public String getExamplesOutputDir() {
        return examplesOutputDir;
    }

    public boolean isHelp() {
        return help;
    }

    public boolean hasConfigs() {
        return !configPaths.isEmpty();
    }

    public void setExamplesOutputDir(String examplesOutputDir) {
        this.examplesOutputDir = examplesOutputDir;
    }

    public void setHelp(boolean help) {
        this.help = help;
    }
}